import { nFormatter } from '@/utils/nFormatter'

export default {
  backgroundColor: '#1c213e',
  grid: {
    bottom: 45,
    left: 50
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      animation: false,
      label: {
        backgroundColor: '#505765'
      }
    }
  },
  dataZoom: [{
    show: false,
    realtime: true,
    start: 0,
    end: 100
  },
  {
    type: 'inside',
    realtime: true,
    top: '90%'
  }
  ],
  xAxis: [{
    name: '时间',
    type: 'category',
    boundaryGap: false,
    nameLocation: 'middle',
    nameGap: 25,
    axisLine: {
      onZero: false,
      lineStyle: {
        color: '#31597d'
      }
    },
    nameTextStyle: {
      color: '#fff',
      verticalAlign: 'top'
    },
    axisLabel: {
      rotate: 0
    },
    splitLine: {
      lineStyle: {
        color: '#41537d',
        type: 'dashed'
      }
    }
  }],
  yAxis: [{
    name: '读数',
    type: 'value',
    scale: true,
    axisLabel: {
      formatter: function (val) {
        return nFormatter(val)
      }
    },
    nameTextStyle: {
      color: '#fff'
    },
    splitLine: {
      lineStyle: {
        color: '#41537d',
        type: 'dashed'
      }
    },
    axisLine: {
      lineStyle: {
        color: '#31597d'
      }
    }
  },
  {
    name: '只',
    nameLocation: 'end',
    type: 'value',
    scale: true,
    nameTextStyle: {
      color: '#fff'
    },
    axisLine: {
      lineStyle: {
        color: '#31597d'
      }
    },
    minInterval: 1,
    axisLabel: {
      formatter: function (val) {
        return nFormatter(val)
      }
    }
  }
  ],
  series: [
    {
      name: '读数',
      type: 'line',
      animation: false,
      areaStyle: {},
      lineStyle: {
        width: 1
      },
      yAxisIndex: 0
    },
    {
      name: '表具数',
      type: 'line',
      animation: false,
      yAxisIndex: 1
    }
  ]
}
